package entity;

import code19_工厂模式.ObjectFactory;

import java.util.Date;

/**
 * @author 黄衡熙
 * @version 1.0
 */
public class User {
    private Integer id;
    private String username;
    private String password;
    //    private Address address = new Address();
    // 在对象中存在工厂的应用时,此处读取的并不是所有的配置,而是当前已加载到的配置
    // 因此,如果在当前对象中存在其他工厂配置,这些配置必须处于该对象的配置之前
    private Address address = (Address) ObjectFactory.getObject("address");
    private Date date = (Date) ObjectFactory.getObject("date");

    public Address getAddress() {
        return address;
    }

    public void setAddress(Address address) {
        this.address = address;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
